﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Scheduling.Models.Interfaces
{
    public interface ICourseLoader
    {
        /// <summary>
        /// Retrieve courses from the database based on specified parameters. 
        /// </summary>
        /// <param name="LoadingFlags">The flags for which optional attributes you want to load. </param>
        /// <returns>List of courses</returns>
        List<Course> GetCourses();

        /// <summary>
        /// Checks if a course exists in the database. 
        /// </summary>
        /// <param name="CourseID">The ID of the course. </param>
        /// <returns>True if it exists. Otherwise False. </returns>
        bool CourseExists(string CourseID);

        /// <summary>
        /// Searches for the course on course name or id, from the pattern provided.
        /// </summary>
        /// <param name="Pattern"></param>
        /// <returns>List</returns>
        List<Course> SearchCoursesByPatten(string Pattern);

        /// <summary>
        /// Adds new course into a database.
        /// </summary>
        /// <param name="course">The course to be added to the database</param>
        void InsertCourse(Course course);

        /// <summary>
        /// Removes course from the database.
        /// </summary>
        /// <param name="CourseID">Course ID must be set in the database to be removed</param>
        void DeleteCourse(string CourseID);

        /// <summary>
        /// Edits course in the database by removing it and adding a new one.
        /// </summary>
        /// <param name="CourseID">Course ID must be set in the database to be edited</param>
        void EditCourse(Course Course);

        /// <summary>
        /// Fetches a course for the given ID.
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        Course GetCourseByID(string ID);


        /// <summary>
        /// Remove all courses.
        /// </summary>
        void Clear();
    }
}